import VueRouter from 'vue-router'
import Vue from 'vue'
import login from './lib/login.vue'
import register from './lib/register.vue'
import Lshow from './lib/login/show.vue'
import Lhidden from './lib/login/hidden.vue'
import Rshow from './lib/register/show.vue'
import Rhidden from './lib/register/hidden.vue'
import home from './components/home.vue'
import user from './components/user.vue'
import shop from './components/shop.vue'
import search from './components/search.vue'
Vue.use(VueRouter)
// 3. 创建路由对象
var router = new VueRouter({
  routes: [
      {
        path:'/login',
        component:login,
        children:[
          {
            path:'show',
            component:Lshow
          },
          {
            path:'hidden',
            component:Lhidden
          }
        ]
    },
    {
      path:'/register',
      component:register,
      children:[
        {
          path:'show',
          component:Rshow
        },
        {
          path:'hidden',
          component:Rhidden
        }
      ]
    },
    {path:'/',redirect:'/home'},
    {path:'/home',component:home},
    {path:'/user',component:user},
    {path:'/shop',component:shop},
    {path:'/search',component:search}
  ],
  linkActiveClass:'mui-active'

})

// 把路由对象暴露出去
export default router